﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    轩轩的小巢-首页
</asp:Content>
<asp:Content ID="HeadScript" ContentPlaceHolderID="HeadScript" runat="server">
    <script type="text/javascript">
        function Vote() {
            var voteContent = "";
            $(".VoteItem:checked").each(function (index, item) {
                voteContent += $(item).val() + ",";
            });

            $.get(
                "handler/VoteHandler.ashx?action=vote",
                { "content": escape(voteContent), "voteid": $("#VoteID").val() },
                function (response, status, xhr) {
                    alert(response);
                },
                "json"
            );
            }

            $(document).ready(function () {
                if ("<%=MySite.Controllers.CurrentHelper.IsRecordVisit %>" == "False") {
                    $.get(
                        "handler/VisitHandler.ashx",
                        { "width": window.screen.width,"height": window.screen.height },
                        function () { }
                       );
                }
            });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="LeftMainContent" runat="server">
    <table width="245" border="0" cellspacing="0" cellpadding="0" style="height: 100%">
        <tr>
            <td height="185" class="left-td-top">
                <div class="title_left">
                    最新教程
                </div>
                <div style="padding-left: 5px; padding-top: 8px; line-height: 20px;">
                    <img alt="" src="../images/1.png" /> OPC入门-4<br />
                    <img alt="" src="../images/1.png" /> OPC入门-3<br />
                    <img alt="" src="../images/1.png" /> OPC入门-2<br />
                    <img alt="" src="../images/1.png" /> OPC入门-1<br />
                    <img alt="" src="../images/1.png" /> SqlServer2012新特性<br />
                    <img alt="" src="../images/1.png" /> HTML5新特性<br />
                    <img alt="" src="../images/1.png" /> IOS开发教程-4<br />
                    <img alt="" src="../images/1.png" /> IOS开发教程-3<br />
                    <img alt="" src="../images/1.png" /> IOS开发教程-2<br />
                    <img alt="" src="../images/1.png" /> IOS开发教程-1
                </div>
            </td>
        </tr>
        <tr>
            <td class="left-td-bottom">
                <div style="padding-top: 11px; text-align: left;">
                    <div class="title_left">
                        投票调查
                    </div>
                    <div style="padding-left: 14px; padding-top: 3px">
                        <div style="line-height: 20px;">
                            <div><span id="VoteTitle">请选择你正在使用的开发语言</span><input type="hidden" id="VoteID" value="0" /><input type="button" value="投票" class="btnVote" onclick="Vote()" /></div>
                            <ul id="VoteItems">
                                <li><a href="">Java</a> <%=Html.RadioButton("java", "Java", false, new { @class = "VoteItem" })%> </li>
                                <li><a href="">C#</a><%=Html.RadioButton("csharp", "C#", false, new { @class = "VoteItem" })%> </li>
                                <li><a href="">C++/C</a><%=Html.RadioButton("ccc", "C++/C", false, new { @class = "VoteItem" })%> </li>
                                <li><a href="">Objective-C</a><%=Html.RadioButton("Objective-C", "Objective-C", false, new { @class = "VoteItem" })%> </li>
                                <li><a href="">PHP</a><%=Html.RadioButton("php", "PHP", false, new { @class = "VoteItem" })%> </li>
                                <li><a href="">Python</a><%=Html.RadioButton("python", "Python", false, new { @class = "VoteItem" })%> </li>
                                <li><a href="">VB</a><%=Html.RadioButton("vb", "VB", false, new { @class = "VoteItem" })%> </li>
                                <li><a href="">其它</a><%=Html.RadioButton("other", "其它", false, new { @class = "VoteItem" })%> </li>
                            </ul>
                            
                        </div>
                    </div>
                </div>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightMainContent" runat="server">
    <table width="744" border="0" cellspacing="0" cellpadding="0" style="text-align: left;">
        <tr>
            <td colspan="3" width="744" height="138" style="background-color:#F4F4F4">
                <table width="744" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td height="138" valign="top" style="width: 100%;">
                            <div style="padding-left:10px;">
                                <div class="title_right_top">
                                    IT业界最新资讯<div style="padding-top: -1px; float: right; padding-right: 10px;">
                                        <strong><a href="http://cnbeta.com/" target="_blank" style="color: #7C7C7C; text-decoration: none">
                                            更多</a>
                                            <img src="../../images/b-1.jpg" alt="" /></strong>
                                    </div>
                                </div>
                                <table class="content_right_table">
                                    
                                
                                <%
                                    System.Collections.Generic.IList<MySite.Model.BlogInfo> cnList = ViewData["CnBetaInfo"] as System.Collections.Generic.IList<MySite.Model.BlogInfo>;
                                    for (var item = 0; item < cnList.Count;item = item + 2 )
                                    { %>
                                <tr>
                                    <td width="50%">
                                        <img src="../../images/b-2.jpg" alt="" style="margin-right: 5px;" />
                                        <a href="<%=cnList[item].OriginalURL%>" target="_blank">
                                            <%=cnList[item].Title.Length > 25 ? cnList[item].Title.Substring(0, 25) + "......" : cnList[item].Title%></a>
                                    </td>
                                    <td width="50%">
                                        <%if(item + 1 <= cnList.Count-1) {%>
                                        <a href="<%=cnList[item].OriginalURL%>" target="_blank">
                                            <img src="../../images/b-2.jpg" alt="" style="left: 350px; margin-right:5px;" />
                                            <%=cnList[item + 1].Title.Length > 25 ? cnList[item + 1].Title.Substring(0, 25) + "......" : cnList[item + 1].Title%></a>
                                            <%} %>
                                    </td>
                                </tr>
                                 
                                <%} %>
                                </table>
                            </div>
                        </td>
                    </tr>

                </table>
            </td>
        </tr>
        <tr>
            <td width="372" height="100%">
                <table width="372"  cellspacing="0" cellpadding="0" style="height: 100%;">
                    <tr>
                        <td style=" height: 100%;">
                            <div style="padding-top: 2px;height:100%;">
                                <div class="title_left">
                                    博客园(程序员之家)最新文章<strong style="float: right; padding-right: 10px;">
                                        <img src="../../images/spacer.gif" width="1" height="9" alt="" />
                                        &nbsp;<a href="http://www.cnblogs.com/" target="_blank">更多</a>
                                        <img src="../../images/b-1.jpg" alt="" /></strong>
                                </div>
                                </div>
                                <div class="content_left">
                                <%
                                    System.Collections.Generic.IList<MySite.Model.BlogInfo> biList = ViewData["BlogCnInfo"] as System.Collections.Generic.IList<MySite.Model.BlogInfo>;
                                  foreach (var item in biList)
                                  { %>
                                        <img src="../../images/b-2.jpg" alt="" />
                                        <a href="<%=item.OriginalURL %>" target="_blank">
                                            <%=item.Title.Length > 25 ? item.Title.Substring(0, 25) + "......" : item.Title%></a><br />
                                  <%} %>
                                    
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
            <td width="372" style="height: 100%;">
                <div style="padding-left: 10px; padding-top: 2px; height:100%; width:100%;">
                    <div class="title_right">我的微博
                            <strong style="float: right; padding-right: 10px; margin-top:0px;">
                            <img src="../../images/spacer.gif" width="1" height="9" alt="" />
                            &nbsp;<a href="http://weibo.com/u/1971003933" target="_blank">更多</a>
                            <img src="../../images/b-1.jpg" alt="" /></strong></div>
                    <div class="content_left">
                  
                     <%
                         System.Collections.Generic.IList<MySite.Model.StatusInfo> siList = ViewData["StatusInfo"] as System.Collections.Generic.IList<MySite.Model.StatusInfo>;
                         foreach (var item in siList)
                                    { %>
                                     <img src="../../images/b-1.jpg" style="margin-left: 3px; margin-right: 8px" />
                                        <a href="#" >
                                            <%=item.Text.Length > 25 ? item.Text.Substring(0, 25) + "......" : item.Text%>
                                        </a>
                                        <br />
                                  <%} %>
                    
                        </div>
                </div>
            </td>
        </tr>
    </table>
</asp:Content>
